package com.lqk.shardingjdbcproj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lqk.shardingjdbcproj.entity.Udict;
import com.lqk.shardingjdbcproj.mapper.UdictMapper;
import com.lqk.shardingjdbcproj.service.UdictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UdictServiceImpl implements UdictService {

    @Autowired
    private UdictMapper udictMapper;

    @Override
    public int insertStatus(Udict udict) {
        int insert = udictMapper.insert(udict);
        return insert;
    }

    @Override
    public Udict selectOne(long udictId) {
        QueryWrapper<Udict> wrapper = new QueryWrapper<>();
        wrapper.eq("dictid",udictId);
        return udictMapper.selectOne(wrapper);
    }

    @Override
    public int deleteById(long udictId) {
        QueryWrapper<Udict> wrapper = new QueryWrapper<>();
        wrapper.eq("dictid",udictId);
        return udictMapper.delete(wrapper);
    }
}
